package com.qjc.demo.train.dp;

/**
 * @ClassName: Fiber
 * @Description: 斐波那契数列: 0 1 1 2 3 5 8 13....
 * @Author: qjc
 * @Date: 2022/5/4 2:00 PM
 */
public class Fiber {

    public static int fun(int n) {
        if (n == 0 || n == 1) {
            return n;
        }
        return fun(n - 1) + fun(n - 2);
    }

    public static void main(String[] args) {
        // 计算n=50的时候已经很吃力了，时间复杂度是O(2^n)，指数级的
        System.out.println(fun(9));
    }


}
